<?php
class User extends AppModel {
	var $name = "User";
	var $validate = array('login' => '/^.{6,40}$/','password_web' => '/^.{6,40}$/');
		
	function validateLogin($data) {
        $user = $this->find('first', array('conditions' => array('login' => $data['login'], 'password_web' => md5($data['password_web'])), 
        									'fields' => array('User.login', 'User.name')));
        if(empty($user) == false)
            return $user['User'];
          else  
        	return false;
    } 
}
?>